<?php 
namespace XFCore\controllers\index;
use lib\{Tips,Template,BaseController};
class IndexController extends BaseController{
    public function __construct(){
       parent::__construct();
    }
    public function index($get){
        $mod = isset($get['mod'])?$get['mod']:'index';
      
        if($this->conf->homepage == 2){
            exit(homepage2($this->conf->homepage_url));
        }else if($this->conf->homepage == 1){
            exit("<script language='javascript'>window.location.href='/user/';</script>");
        }
        $loadfile = Template::load($mod);
        $conf = $this->conf;
        include $loadfile;
    }
    public function SDK(){
        if($this->conf->test_open == 0){
            Tips::error("管理员未开启此功能","未启用","/");
        }
        if(!isMobile()){
            include indextem . 'PCSDK.php';
        }else{
            include indextem.'webSDK.php';
        }
    }
    public function Retrieve($get){
        if(empty($get['token'])){
            $this->echomsg('Tips',"token不存在");
        }
        $token = aes256auth($get['token'] , SYS_KEY , 'DECODE');
        if(empty($token)){
            $this->echomsg('Tips',"token错误");
        }
        $arr = json_decode($token , true);
        if ($arr['time'] < time() - 1800){
            $this->echomsg('Tips',"链接已失效");
        } 
        
        include indextem.'Retrieve.php';
    }
}


?>